package org.jeecg.modules.aliyun.entity.run;

import cn.hutool.core.util.RandomUtil;
import org.jeecg.modules.phone.entity.*;
import org.jeecg.modules.phone.mapper.*;
import org.springframework.beans.factory.annotation.Autowired;

import static org.jeecg.modules.aliyun.entity.run.TaskUtil.*;

public class PhoneEntityTaskM1Util    {
    @Autowired
    PhoneEntityTask phoneEntityTask;
    @Autowired
    PhoneEntity phoneEntity;
    @Autowired
    PhoneAccountLogMapper phoneAccountLogMapper;
    @Autowired
    PhoneEntityCmdMapper phoneEntityCmdMapper;


    /*母号1的5个步骤*/

    public static void asdfa434(PhoneEntityTask phoneEntityTask) {

        System.out.println("asdfa434----------------" + phoneEntityTask.getEntityId());

        cmdBy4G(phoneEntityTask,"input keyevent  3");
        cmdBy4G(phoneEntityTask,"input tap 151 1340");  //点击抖猫图标，放到主屏第一个位置

        String fileName = "screen_" + RandomUtil.randomString(8) + ".png";
        saveScreen(phoneEntityTask,fileName);
        TaskUtil.checkPointJob(phoneEntityTask,"a1",0  );


      }


    public static void asdfa435(PhoneEntityTask phoneEntityTask) {
        cmdBy4G(phoneEntityTask,"input tap 434 286"); //点击搜索框434 286
        cmdBy4G(phoneEntityTask,"ime set com.android.adbkeyboard/.AdbIME");
        cmdBy4G(phoneEntityTask,"input tap 434 307");//点击专题搜索框434 307

        String searchKey = "你是什么脸型,你是什么脸型,你是什么脸型".split(",")[ RandomUtil.randomInt(0,2)];
        cmdBy4G(phoneEntityTask,"am broadcast -a ADB_INPUT_TEXT --es msg '"+searchKey+"'");
//        am broadcast -a ADB_INPUT_TEXT --es msg '你是什么脸型'
        cmdBy4G(phoneEntityTask,"input tap 969 299"); //搜索确定969 299

        String fileName = "screen_" + RandomUtil.randomString(8) + ".png";
        saveScreen(phoneEntityTask,fileName);
        TaskUtil.checkPointJob(phoneEntityTask,"a1",1  );

    }


    public static void asdfa436(PhoneEntityTask phoneEntityTask) {
        cmdBy4G(phoneEntityTask,"input tap 957 499"); //点击扫码推广957 499
        String fileName = "screen_" + RandomUtil.randomString(8) + ".png";
        saveScreen(phoneEntityTask,fileName);

        cmdBy4G(phoneEntityTask,"am force-stop com.doutui.bozhong");
        TaskUtil.checkPointJob(phoneEntityTask,"a1",2  );
    }


    public static void asdfa437(PhoneEntityTask phoneEntityTask) {
        cmdBy4G(phoneEntityTask,"am force-stop com.ss.android.ugc.aweme");
        cmdBy4G(phoneEntityTask,"am start com.ss.android.ugc.aweme/.main.MainActivity");
        sleepSecond(200,"打开抖音很慢");
        cmdBy4G(phoneEntityTask,"input tap 83 137"); //抖音扫一扫83 137

        cmdBy4G(phoneEntityTask,"input tap 832 1499");////相册832 1499
        cmdBy4G(phoneEntityTask,"input tap 134 487");//相册第一张134 487

//        这里抖音授权超级忙
        sleepSecond(200,"抖音授权");
        cmdBy4G(phoneEntityTask,"input tap 73 1559");//同意授权73 1559
        cmdBy4G(phoneEntityTask,"input tap 798 1686"); //同意按钮798 1686

        TaskUtil.checkPointJob(phoneEntityTask,"a1",3  );
    }


    public static void asdfa438(PhoneEntityTask phoneEntityTask) {
        cmdBy4G(phoneEntityTask,"input tap 992 362"); //拍视频992 362
        sleepSecond(5);
        cmdBy4G(phoneEntityTask,"input tap 851 1551"); ////点相册851 1551
        cmdBy4G(phoneEntityTask,"input tap 136 493"); //////点第一张136 493
        cmdBy4G(phoneEntityTask,"input tap 906 1725"); ////点确定906 1725
        cmdBy4G(phoneEntityTask,"input tap 545 1715"); ////下一步545 1715

        //获取文本文件，读取内容，粘贴进来。

        cmdBy4G(phoneEntityTask,"input tap 185 309"); //点击文本区域185 309
        cmdBy4G(phoneEntityTask,"shell ime set com.android.adbkeyboard/.AdbIME"); ////下一步545 1715
        cmdBy4G(phoneEntityTask,"shell am broadcast -a ADB_INPUT_TEXT --es msg '这个是一个很牛的作品'"); ////下一步545 1715


        cmdBy4G(phoneEntityTask,"input tap 818 1715"); //发布818 1715

        cmdBy4G(phoneEntityTask,"input tap 990 145");  //关闭作品990 145
        cmdBy4G(phoneEntityTask,"input keyevent 4");  //返回
        cmdBy4G(phoneEntityTask,"input tap 967 1727");    //我967 1727
        cmdBy4G(phoneEntityTask,"input swipe 300 800 300 80");    //我967 1727上滑
        cmdBy4G(phoneEntityTask,"input tap 181 725");   //第一作品181 725  //点点点982 1372
        cmdBy4G(phoneEntityTask,"input tap 982 1372");      //点点点982 1372
        cmdBy4G(phoneEntityTask,"input tap 982 1372");      //点点点982 1372
        TaskUtil.checkPointJob(phoneEntityTask,"a1",4  );


    }




}